(function (a)
{
  a.fn.clippy = function (b)
  {
    _opts = {
      width: "14",
      height: "14",
      color: "#ffffff",
      clippy_path: "clippy.swf",
      keep_text: !1,
      transparent: !1
    }, b = a.extend(_opts, b), params = {
      movie: b.clippy_path,
      allowScriptAccess: "always",
      quality: "high",
      scale: "noscale"
    }, b.transparent && typeof b.transparent == "string" ? params.wmode = b.transparent : b.transparent && typeof b.transparent == "boolean" ? params.wmode = "transparent" : params.bgcolor = b.color, embed_params = a.extend(
    {}, params,
    {
      width: b.width,
      height: b.height
    }), embed_params.src = embed_params.movie, delete embed_params.movie, this.each(function (c, d)
    {
      b.text && b.text != "" ? text = b.text : a(d)
        .data("text") && a(d)
        .data("text") != "" ? text = a(d)
        .data("text") : text = a(d)
        .text(), text = encodeURIComponent(text), params.FlashVars = "text=" + text, embed_params.FlashVars = "text=" + text, dom = a("<object />")
        .attr(
        {
          classid: "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
          width: b.width,
          height: b.height
        }), embed = a("<embed />")
        .attr(embed_params);
      try
      {
        dom.append(embed), a.each(params, function (b, c)
        {
          dom.prepend(a("<param />")
            .attr(
            {
              name: b,
              value: c
            }))
        })
      }
      catch (e)
      {
        dom = embed
      }
      b.keep_text ? a(d)
        .html(dom)
        .append(decodeURIComponent(text)) : a(d)
        .html(dom)
    })
  }
})(jQuery);
var jscolor = {
  dir: "",
  bindClass: "color",
  binding: !0,
  preloading: !0,
  install: function ()
  {
    jscolor.addEvent(window, "load", jscolor.init)
  },
  init: function ()
  {
    jscolor.binding && jscolor.bind(), jscolor.preloading && jscolor.preload()
  },
  getDir: function ()
  {
    if (!jscolor.dir)
    {
      var a = jscolor.detectDir();
      jscolor.dir = a !== !1 ? a : "jscolor/"
    }
    return jscolor.dir
  },
  detectDir: function ()
  {
    var a = location.href,
      b = document.getElementsByTagName("base");
    for (var c = 0; c < b.length; c += 1) b[c].href && (a = b[c].href);
    var b = document.getElementsByTagName("script");
    for (var c = 0; c < b.length; c += 1) if (b[c].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(b[c].src))
      {
        var d = new jscolor.URI(b[c].src),
          e = d.toAbsolute(a);
        return e.path = e.path.replace(/[^\/]+$/, ""), e.query = null, e.fragment = null, e.toString()
      }
    return !1
  },
  bind: function ()
  {
    var matchClass = new RegExp("(^|\\s)(" + jscolor.bindClass + ")\\s*(\\{[^}]*\\})?", "i"),
      e = document.getElementsByTagName("input");
    for (var i = 0; i < e.length; i += 1)
    {
      var m;
      if (!e[i].color && e[i].className && (m = e[i].className.match(matchClass)))
      {
        var prop = {};
        if (m[3]) try
          {
            eval("prop=" + m[3])
        }
        catch (eInvalidProp)
        {}
        e[i].color = new jscolor.color(e[i], prop)
      }
    }
  },
  preload: function ()
  {
    for (var a in jscolor.imgRequire) jscolor.imgRequire.hasOwnProperty(a) && jscolor.loadImage(a)
  },
  images:
  {
    pad: [181, 101],
    sld: [16, 101],
    cross: [15, 15],
    arrow: [7, 11]
  },
  imgRequire:
  {},
  imgLoaded:
  {},
  requireImage: function (a)
  {
    jscolor.imgRequire[a] = !0
  },
  loadImage: function (a)
  {
    jscolor.imgLoaded[a] || (jscolor.imgLoaded[a] = new Image, jscolor.imgLoaded[a].src = jscolor.getDir() + a)
  },
  fetchElement: function (a)
  {
    return typeof a == "string" ? document.getElementById(a) : a
  },
  addEvent: function (a, b, c)
  {
    a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent && a.attachEvent("on" + b, c)
  },
  fireEvent: function (a, b)
  {
    if (!a) return;
    if (document.createEvent)
    {
      var c = document.createEvent("HTMLEvents");
      c.initEvent(b, !0, !0), a.dispatchEvent(c)
    }
    else if (document.createEventObject)
    {
      var c = document.createEventObject();
      a.fireEvent("on" + b, c)
    }
    else a["on" + b] && a["on" + b]()
  },
  getElementPos: function (a)
  {
    var b = a,
      c = a,
      d = 0,
      e = 0;
    if (b.offsetParent) do d += b.offsetLeft, e += b.offsetTop;
    while (b = b.offsetParent);
    while ((c = c.parentNode) && c.nodeName.toUpperCase() !== "BODY") d -= c.scrollLeft, e -= c.scrollTop;
    return [d, e]
  },
  getElementSize: function (a)
  {
    return [a.offsetWidth, a.offsetHeight]
  },
  getRelMousePos: function (a)
  {
    var b = 0,
      c = 0;
    return a || (a = window.event), typeof a.offsetX == "number" ? (b = a.offsetX, c = a.offsetY) : typeof a.layerX == "number" && (b = a.layerX, c = a.layerY),
    {
      x: b,
      y: c
    }
  },
  getViewPos: function ()
  {
    return typeof window.pageYOffset == "number" ? [window.pageXOffset, window.pageYOffset] : document.body && (document.body.scrollLeft || document.body.scrollTop) ? [document.body.scrollLeft, document.body.scrollTop] : document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop) ? [document.documentElement.scrollLeft, document.documentElement.scrollTop] : [0, 0]
  },
  getViewSize: function ()
  {
    return typeof window.innerWidth == "number" ? [window.innerWidth, window.innerHeight] : document.body && (document.body.clientWidth || document.body.clientHeight) ? [document.body.clientWidth, document.body.clientHeight] : document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ? [document.documentElement.clientWidth, document.documentElement.clientHeight] : [0, 0]
  },
  URI: function (a)
  {
    function b(a)
    {
      var b = "";
      while (a) if (a.substr(0, 3) === "../" || a.substr(0, 2) === "./") a = a.replace(/^\.+/, "")
            .substr(1);
        else if (a.substr(0, 3) === "/./" || a === "/.") a = "/" + a.substr(3);
      else if (a.substr(0, 4) === "/../" || a === "/..") a = "/" + a.substr(4), b = b.replace(/\/?[^\/]*$/, "");
      else if (a === "." || a === "..") a = "";
      else
      {
        var c = a.match(/^\/?[^\/]*/)[0];
        a = a.substr(c.length), b += c
      }
      return b
    }
    this.scheme = null, this.authority = null, this.path = "", this.query = null, this.fragment = null, this.parse = function (a)
    {
      var b = a.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
      return this.scheme = b[3] ? b[2] : null, this.authority = b[5] ? b[6] : null, this.path = b[7], this.query = b[9] ? b[10] : null, this.fragment = b[12] ? b[13] : null, this
    }, this.toString = function ()
    {
      var a = "";
      return this.scheme !== null && (a = a + this.scheme + ":"), this.authority !== null && (a = a + "//" + this.authority), this.path !== null && (a += this.path), this.query !== null && (a = a + "?" + this.query), this.fragment !== null && (a = a + "#" + this.fragment), a
    }, this.toAbsolute = function (a)
    {
      var a = new jscolor.URI(a),
        c = this,
        d = new jscolor.URI;
      return a.scheme === null ? !1 : (c.scheme !== null && c.scheme.toLowerCase() === a.scheme.toLowerCase() && (c.scheme = null), c.scheme !== null ? (d.scheme = c.scheme, d.authority = c.authority, d.path = b(c.path), d.query = c.query) : (c.authority !== null ? (d.authority = c.authority, d.path = b(c.path), d.query = c.query) : (c.path === "" ? (d.path = a.path, c.query !== null ? d.query = c.query : d.query = a.query) : (c.path.substr(0, 1) === "/" ? d.path = b(c.path) : (a.authority !== null && a.path === "" ? d.path = "/" + c.path : d.path = a.path.replace(/[^\/]+$/, "") + c.path, d.path = b(d.path)), d.query = c.query), d.authority = a.authority), d.scheme = a.scheme), d.fragment = c.fragment, d)
    }, a && this.parse(a)
  },
  color: function (target, prop)
  {
    function RGB_HSV(a, b, c)
    {
      var d = Math.min(Math.min(a, b), c),
        e = Math.max(Math.max(a, b), c),
        f = e - d;
      if (f === 0) return [null, 0, e];
      var g = a === d ? 3 + (c - b) / f : b === d ? 5 + (a - c) / f : 1 + (b - a) / f;
      return [g === 6 ? 0 : g, f / e, e]
    }

    function HSV_RGB(a, b, c)
    {
      if (a === null) return [c, c, c];
      var d = Math.floor(a),
        e = d % 2 ? a - d : 1 - (a - d),
        f = c * (1 - b),
        g = c * (1 - b * e);
      switch (d)
      {
      case 6:
      case 0:
        return [c, g, f];
      case 1:
        return [g, c, f];
      case 2:
        return [f, c, g];
      case 3:
        return [f, g, c];
      case 4:
        return [g, f, c];
      case 5:
        return [c, f, g]
      }
    }

    function removePicker()
    {
      delete jscolor.picker.owner, document.getElementsByTagName("body")[0].removeChild(jscolor.picker.boxB)
    }

    function drawPicker(a, b)
    {
      function i()
      {
        var a = THIS.pickerInsetColor.split(/\s+/),
          b = a.length < 2 ? a[0] : a[1] + " " + a[0] + " " + a[0] + " " + a[1];
        f.btn.style.borderColor = b
      }
      if (!jscolor.picker)
      {
        jscolor.picker = {
          box: document.createElement("div"),
          boxB: document.createElement("div"),
          pad: document.createElement("div"),
          padB: document.createElement("div"),
          padM: document.createElement("div"),
          sld: document.createElement("div"),
          sldB: document.createElement("div"),
          sldM: document.createElement("div"),
          btn: document.createElement("div"),
          btnS: document.createElement("span"),
          btnT: document.createTextNode(THIS.pickerCloseText)
        };
        for (var c = 0, d = 4; c < jscolor.images.sld[1]; c += d)
        {
          var e = document.createElement("div");
          e.style.height = d + "px", e.style.fontSize = "1px", e.style.lineHeight = "0", jscolor.picker.sld.appendChild(e)
        }
        jscolor.picker.sldB.appendChild(jscolor.picker.sld), jscolor.picker.box.appendChild(jscolor.picker.sldB), jscolor.picker.box.appendChild(jscolor.picker.sldM), jscolor.picker.padB.appendChild(jscolor.picker.pad), jscolor.picker.box.appendChild(jscolor.picker.padB), jscolor.picker.box.appendChild(jscolor.picker.padM), jscolor.picker.btnS.appendChild(jscolor.picker.btnT), jscolor.picker.btn.appendChild(jscolor.picker.btnS), jscolor.picker.box.appendChild(jscolor.picker.btn), jscolor.picker.boxB.appendChild(jscolor.picker.box)
      }
      var f = jscolor.picker;
      f.box.className = modeID ? "value" : "saturation", f.box.onmouseup = f.box.onmouseout = function ()
      {
        target.focus()
      }, f.box.onmousedown = function ()
      {
        abortBlur = !0
      }, f.box.onmousemove = function (a)
      {
        if (holdPad || holdSld) holdPad && setPad(a), holdSld && setSld(a), document.selection ? document.selection.empty() : window.getSelection && window.getSelection()
            .removeAllRanges(), dispatchImmediateChange()
      }, f.padM.onmouseup = f.padM.onmouseout = function ()
      {
        holdPad && (holdPad = !1, jscolor.fireEvent(valueElement, "change"))
      }, f.padM.onmousedown = function (a)
      {
        switch (modeID)
        {
        case 0:
          THIS.hsv[2] === 0 && THIS.fromHSV(null, null, 1);
          break;
        case 1:
          THIS.hsv[1] === 0 && THIS.fromHSV(null, 1, null)
        }
        holdPad = !0, setPad(a), dispatchImmediateChange()
      }, f.sldM.onmouseup = f.sldM.onmouseout = function ()
      {
        holdSld && (holdSld = !1, jscolor.fireEvent(valueElement, "change"))
      }, f.sldM.onmousedown = function (a)
      {
        holdSld = !0, setSld(a), dispatchImmediateChange()
      };
      var g = getPickerDims(THIS);
      f.box.style.width = g[0] + "px", f.box.style.height = g[1] + "px", f.boxB.className = "jscolor", f.boxB.style.position = "absolute", f.boxB.style.clear = "both", f.boxB.style.left = a + "px", f.boxB.style.top = b + "px", f.boxB.style.zIndex = THIS.pickerZIndex, f.boxB.style.border = THIS.pickerBorder + "px solid", f.boxB.style.borderColor = THIS.pickerBorderColor, f.boxB.style.background = THIS.pickerFaceColor, f.pad.className = "pad", f.pad.style.width = jscolor.images.pad[0] + "px", f.pad.style.height = jscolor.images.pad[1] + "px", f.padB.style.position = "absolute", f.padB.style.left = THIS.pickerFace + "px", f.padB.style.top = THIS.pickerFace + "px", f.padB.style.border = THIS.pickerInset + "px solid", f.padB.style.borderColor = THIS.pickerInsetColor, f.padM.className = "cross", f.padM.style.position = "absolute", f.padM.style.left = "0", f.padM.style.top = "0", f.padM.style.width = THIS.pickerFace + 2 * THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + "px", f.padM.style.height = f.box.style.height, f.padM.style.cursor = "crosshair", f.sld.style.overflow = "hidden", f.sld.style.width = jscolor.images.sld[0] + "px", f.sld.style.height = jscolor.images.sld[1] + "px", f.sldB.style.display = THIS.slider ? "block" : "none", f.sldB.style.position = "absolute", f.sldB.style.right = THIS.pickerFace + "px", f.sldB.style.top = THIS.pickerFace + "px", f.sldB.style.border = THIS.pickerInset + "px solid", f.sldB.style.borderColor = THIS.pickerInsetColor, f.sldM.className = "arrow", f.sldM.style.display = THIS.slider ? "block" : "none", f.sldM.style.position = "absolute", f.sldM.style.right = "0", f.sldM.style.top = "0", f.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2 * THIS.pickerInset + "px", f.sldM.style.height = f.box.style.height;
      try
      {
        f.sldM.style.cursor = "pointer"
      }
      catch (h)
      {
        f.sldM.style.cursor = "hand"
      }
      f.btn.style.display = THIS.pickerClosable ? "block" : "none", f.btn.style.position = "absolute", f.btn.style.left = THIS.pickerFace + "px", f.btn.style.bottom = THIS.pickerFace + "px", f.btn.style.padding = "0 15px", f.btn.style.height = "18px", f.btn.style.border = THIS.pickerInset + "px solid", i(), f.btn.style.color = THIS.pickerButtonColor, f.btn.style.font = "12px sans-serif", f.btn.style.textAlign = "center";
      try
      {
        f.btn.style.cursor = "pointer"
      }
      catch (h)
      {
        f.btn.style.cursor = "hand"
      }
      f.btn.onmousedown = function ()
      {
        THIS.hidePicker()
      }, f.btnS.style.lineHeight = f.btn.style.height, redrawPad(), redrawSld(), jscolor.picker.owner = THIS, document.getElementsByTagName("body")[0].appendChild(f.boxB)
    }

    function getPickerDims(a)
    {
      var b = [2 * a.pickerInset + 2 * a.pickerFace + jscolor.images.pad[0] + (a.slider ? 2 * a.pickerInset + 2 * jscolor.images.arrow[0] + jscolor.images.sld[0] : 0), a.pickerClosable ? 4 * a.pickerInset + 3 * a.pickerFace + jscolor.images.pad[1] + a.pickerButtonHeight : 2 * a.pickerInset + 2 * a.pickerFace + jscolor.images.pad[1]];
      return b
    }

    function redrawPad()
    {
      switch (modeID)
      {
      case 0:
        var a = 1;
        break;
      case 1:
        var a = 2
      }
      var b = Math.round(THIS.hsv[0] / 6 * (jscolor.images.pad[0] - 1)),
        c = Math.round((1 - THIS.hsv[a]) * (jscolor.images.pad[1] - 1));
      jscolor.picker.padM.style.backgroundPosition = THIS.pickerFace + THIS.pickerInset + b - Math.floor(jscolor.images.cross[0] / 2) + "px " + (THIS.pickerFace + THIS.pickerInset + c - Math.floor(jscolor.images.cross[1] / 2)) + "px";
      var d = jscolor.picker.sld.childNodes;
      switch (modeID)
      {
      case 0:
        var e = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
        for (var f = 0; f < d.length; f += 1) d[f].style.backgroundColor = "rgb(" + e[0] * (1 - f / d.length) * 100 + "%," + e[1] * (1 - f / d.length) * 100 + "%," + e[2] * (1 - f / d.length) * 100 + "%)";
        break;
      case 1:
        var e, g, h = [THIS.hsv[2], 0, 0],
          f = Math.floor(THIS.hsv[0]),
          i = f % 2 ? THIS.hsv[0] - f : 1 - (THIS.hsv[0] - f);
        switch (f)
        {
        case 6:
        case 0:
          e = [0, 1, 2];
          break;
        case 1:
          e = [1, 0, 2];
          break;
        case 2:
          e = [2, 0, 1];
          break;
        case 3:
          e = [2, 1, 0];
          break;
        case 4:
          e = [1, 2, 0];
          break;
        case 5:
          e = [0, 2, 1]
        }
        for (var f = 0; f < d.length; f += 1) g = 1 - 1 / (d.length - 1) * f, h[1] = h[0] * (1 - g * i), h[2] = h[0] * (1 - g), d[f].style.backgroundColor = "rgb(" + h[e[0]] * 100 + "%," + h[e[1]] * 100 + "%," + h[e[2]] * 100 + "%)"
      }
    }

    function redrawSld()
    {
      switch (modeID)
      {
      case 0:
        var a = 2;
        break;
      case 1:
        var a = 1
      }
      var b = Math.round((1 - THIS.hsv[a]) * (jscolor.images.sld[1] - 1));
      jscolor.picker.sldM.style.backgroundPosition = "0 " + (THIS.pickerFace + THIS.pickerInset + b - Math.floor(jscolor.images.arrow[1] / 2)) + "px"
    }

    function isPickerOwner()
    {
      return jscolor.picker && jscolor.picker.owner === THIS
    }

    function blurTarget()
    {
      valueElement === target && THIS.importColor(), THIS.pickerOnfocus && THIS.hidePicker()
    }

    function blurValue()
    {
      valueElement !== target && THIS.importColor()
    }

    function setPad(a)
    {
      var b = jscolor.getRelMousePos(a),
        c = b.x - THIS.pickerFace - THIS.pickerInset,
        d = b.y - THIS.pickerFace - THIS.pickerInset;
      switch (modeID)
      {
      case 0:
        THIS.fromHSV(c * (6 / (jscolor.images.pad[0] - 1)), 1 - d / (jscolor.images.pad[1] - 1), null, leaveSld);
        break;
      case 1:
        THIS.fromHSV(c * (6 / (jscolor.images.pad[0] - 1)), null, 1 - d / (jscolor.images.pad[1] - 1), leaveSld)
      }
    }

    function setSld(a)
    {
      var b = jscolor.getRelMousePos(a),
        c = b.y - THIS.pickerFace - THIS.pickerInset;
      switch (modeID)
      {
      case 0:
        THIS.fromHSV(null, null, 1 - c / (jscolor.images.sld[1] - 1), leavePad);
        break;
      case 1:
        THIS.fromHSV(null, 1 - c / (jscolor.images.sld[1] - 1), null, leavePad)
      }
    }

    function dispatchImmediateChange()
    {
      THIS.onImmediateChange && (typeof THIS.onImmediateChange == "string" ? eval(THIS.onImmediateChange) : THIS.onImmediateChange(THIS))
    }
    this.required = !0, this.adjust = !0, this.hash = !1, this.caps = !0, this.slider = !0, this.valueElement = target, this.styleElement = target, this.onImmediateChange = null, this.hsv = [0, 0, 1], this.rgb = [1, 1, 1], this.pickerOnfocus = !0, this.pickerMode = "HSV", this.pickerPosition = "bottom", this.pickerSmartPosition = !0, this.pickerButtonHeight = 20, this.pickerClosable = !1, this.pickerCloseText = "Close", this.pickerButtonColor = "ButtonText", this.pickerFace = 10, this.pickerFaceColor = "ThreeDFace", this.pickerBorder = 1, this.pickerBorderColor = "ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight", this.pickerInset = 1, this.pickerInsetColor = "ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow", this.pickerZIndex = 1e4;
    for (var p in prop) prop.hasOwnProperty(p) && (this[p] = prop[p]);
    this.hidePicker = function ()
    {
      isPickerOwner() && removePicker()
    }, this.showPicker = function ()
    {
      if (!isPickerOwner())
      {
        var a = jscolor.getElementPos(target),
          b = jscolor.getElementSize(target),
          c = jscolor.getViewPos(),
          d = jscolor.getViewSize(),
          e = getPickerDims(this),
          f, g, h;
        switch (this.pickerPosition.toLowerCase())
        {
        case "left":
          f = 1, g = 0, h = -1;
          break;
        case "right":
          f = 1, g = 0, h = 1;
          break;
        case "top":
          f = 0, g = 1, h = -1;
          break;
        default:
          f = 0, g = 1, h = 1
        }
        var i = (b[g] + e[g]) / 2;
        if (!this.pickerSmartPosition) var j = [a[f], a[g] + b[g] - i + i * h];
        else var j = [-c[f] + a[f] + e[f] > d[f] ? -c[f] + a[f] + b[f] / 2 > d[f] / 2 && a[f] + b[f] - e[f] >= 0 ? a[f] + b[f] - e[f] : a[f] : a[f], -c[g] + a[g] + b[g] + e[g] - i + i * h > d[g] ? -c[g] + a[g] + b[g] / 2 > d[g] / 2 && a[g] + b[g] - i - i * h >= 0 ? a[g] + b[g] - i - i * h : a[g] + b[g] - i + i * h : a[g] + b[g] - i + i * h >= 0 ? a[g] + b[g] - i + i * h : a[g] + b[g] - i - i * h];
        drawPicker(j[f], j[g])
      }
    }, this.importColor = function ()
    {
      valueElement ? this.adjust ? !this.required && /^\s*$/.test(valueElement.value) ? (valueElement.value = "", styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage, styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor, styleElement.style.color = styleElement.jscStyle.color, this.exportColor(leaveValue | leaveStyle)) : this.fromString(valueElement.value) || this.exportColor() : this.fromString(valueElement.value, leaveValue) || (styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage, styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor, styleElement.style.color = styleElement.jscStyle.color, this.exportColor(leaveValue | leaveStyle)) : this.exportColor()
    }, this.exportColor = function (a)
    {
      if (!(a & leaveValue) && valueElement)
      {
        var b = this.toString();
        this.caps && (b = b.toUpperCase()), this.hash && (b = "#" + b), valueElement.value = b
      }!(a & leaveStyle) && styleElement && (styleElement.style.backgroundImage = "none", styleElement.style.backgroundColor = "#" + this.toString(), styleElement.style.color = .213 * this.rgb[0] + .715 * this.rgb[1] + .072 * this.rgb[2] < .5 ? "#FFF" : "#000"), !(a & leavePad) && isPickerOwner() && redrawPad(), !(a & leaveSld) && isPickerOwner() && redrawSld()
    }, this.fromHSV = function (a, b, c, d)
    {
      a < 0 && (a = 0) || a > 6 && (a = 6), b < 0 && (b = 0) || b > 1 && (b = 1), c < 0 && (c = 0) || c > 1 && (c = 1), this.rgb = HSV_RGB(a === null ? this.hsv[0] : this.hsv[0] = a, b === null ? this.hsv[1] : this.hsv[1] = b, c === null ? this.hsv[2] : this.hsv[2] = c), this.exportColor(d)
    }, this.fromRGB = function (a, b, c, d)
    {
      a < 0 && (a = 0) || a > 1 && (a = 1), b < 0 && (b = 0) || b > 1 && (b = 1), c < 0 && (c = 0) || c > 1 && (c = 1);
      var e = RGB_HSV(a === null ? this.rgb[0] : this.rgb[0] = a, b === null ? this.rgb[1] : this.rgb[1] = b, c === null ? this.rgb[2] : this.rgb[2] = c);
      e[0] !== null && (this.hsv[0] = e[0]), e[2] !== 0 && (this.hsv[1] = e[1]), this.hsv[2] = e[2], this.exportColor(d)
    }, this.fromString = function (a, b)
    {
      var c = a.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
      return c ? (c[1].length === 6 ? this.fromRGB(parseInt(c[1].substr(0, 2), 16) / 255, parseInt(c[1].substr(2, 2), 16) / 255, parseInt(c[1].substr(4, 2), 16) / 255, b) : this.fromRGB(parseInt(c[1].charAt(0) + c[1].charAt(0), 16) / 255, parseInt(c[1].charAt(1) + c[1].charAt(1), 16) / 255, parseInt(c[1].charAt(2) + c[1].charAt(2), 16) / 255, b), !0) : !1
    }, this.toString = function ()
    {
      return (256 | Math.round(255 * this.rgb[0]))
        .toString(16)
        .substr(1) + (256 | Math.round(255 * this.rgb[1]))
        .toString(16)
        .substr(1) + (256 | Math.round(255 * this.rgb[2]))
        .toString(16)
        .substr(1)
    };
    var THIS = this,
      modeID = this.pickerMode.toLowerCase() === "hvs" ? 1 : 0,
      abortBlur = !1,
      valueElement = jscolor.fetchElement(this.valueElement),
      styleElement = jscolor.fetchElement(this.styleElement),
      holdPad = !1,
      holdSld = !1,
      leaveValue = 1,
      leaveStyle = 2,
      leavePad = 4,
      leaveSld = 8;
    jscolor.addEvent(target, "focus", function ()
    {
      THIS.pickerOnfocus && THIS.showPicker()
    }), jscolor.addEvent(target, "blur", function ()
    {
      abortBlur ? abortBlur = !1 : window.setTimeout(function ()
      {
        abortBlur || blurTarget(), abortBlur = !1
      }, 0)
    });
    if (valueElement)
    {
      var updateField = function ()
      {
        THIS.fromString(valueElement.value, leaveValue), dispatchImmediateChange()
      };
      jscolor.addEvent(valueElement, "keyup", updateField), jscolor.addEvent(valueElement, "input", updateField), jscolor.addEvent(valueElement, "blur", blurValue), valueElement.setAttribute("autocomplete", "off")
    }
    styleElement && (styleElement.jscStyle = {
      backgroundImage: styleElement.style.backgroundImage,
      backgroundColor: styleElement.style.backgroundColor,
      color: styleElement.style.color
    }), this.importColor()
  }
};
jscolor.install(), "CSSArrowPlease" in window || (window.CSSArrowPlease = {}),
function (a)
{
  var b = function ()
  {
    this.init.apply(this, arguments)
  };
  b.prototype = {
    init: function ()
    {
      this._$self = $(this), this._createAttrs()
    },
    invertedPosition: function ()
    {
      var a = this.get("position");
      if (a === "top") return "bottom";
      if (a === "bottom") return "top";
      if (a === "left") return "right";
      if (a === "right") return "left"
    },
    hexToRGB: function (a)
    {
      if (typeof a != "string" || !a.match(/^#([0-9A-F]{3}$)|([0-9A-F]{6}$)/i)) return [0, 0, 0];
      a.match(/^(#[0-9a-f]{3})$/i) && (a = "#" + a[1] + a[1] + a[2] + a[2] + a[3] + a[3]);
      var b = [],
        c = 1;
      for (; c < 6; c += 2) b.push(parseInt(a.substring(c, c + 2), 16));
      return b
    },
    _baseCSS: function ()
    {
      var a = this.invertedPosition(),
        b = this.get("color"),
        c = this.get("borderWidth"),
        d = this.get("borderColor"),
        e = c > 0,
        f = ".arrow_box {\n";
      return f += "	position: relative;\n", f += "	background: " + b + ";\n", e && (f += "	border: " + c + "px solid " + d + ";\n"), f += "}\n", f += ".arrow_box:after", e ? f += ", .arrow_box:before {\n" : f += " {\n", f += "	" + a + ": 100%;\n", f += "	border: solid transparent;\n", f += '	content: " ";\n', f += "	height: 0;\n", f += "	width: 0;\n", f += "	position: absolute;\n", f += "	pointer-events: none;\n", f += "}\n", f
    },
    _arrowCSS: function (a, b, c)
    {
      var d = this.get("position"),
        e = this.invertedPosition(),
        f = this.hexToRGB(a),
        g = ".arrow_box:";
      return c = c || "after", g += c + " {\n", g += "	border-color: rgba(" + f.join(", ") + ", 0);\n", g += "	border-" + e + "-color: " + a + ";\n", g += "	border-width: " + b + "px;\n", d === "top" || d === "bottom" ? g += "	left: 50%;\n	margin-left: -" + b + "px;\n" : g += "	top: 50%;\n	margin-top: -" + b + "px;\n", g += "}", g
    },
    _baseArrowCSS: function ()
    {
      return this._arrowCSS(this.get("color"), this.get("size"), "after")
    },
    _arrowBorderCSS: function ()
    {
      var a = "",
        b = this.get("borderWidth");
      return b > 0 && (a = this._arrowCSS(this.get("borderColor"), this.get("size") + Math.round(b * 1.41421356), "before")), a
    },
    toCSS: function ()
    {
      var a = [this._baseCSS(), this._baseArrowCSS(), this._arrowBorderCSS()];
      return a.join("\n")
    },
    _createAttrs: function ()
    {
      var a = b.ATTRS,
        c = {};
      $.each(a, function (a, b)
      {
        c[a] = b
      }), this._attributes = c
    },
    getAttrs: function ()
    {
      return this._attributes
    },
    get: function (a)
    {
      return this._attributes[a]
    },
    set: function (a, b)
    {
      if (!(a in this._attributes)) return;
      this._attributes[a] = b, this.fire("change")
    },
    on: function (a, b, c)
    {
      var d = this._$self;
      d.on(a, $.proxy(b, c || this))
    },
    fire: function (a)
    {
      var b = this._$self;
      b.trigger(a)
    }
  }, b.ATTRS = {
    position: "top",
    size: 30,
    color: "#88b7d5",
    borderWidth: 4,
    borderColor: "#c2e1f5"
  }, a.Arrow = b
}(window.CSSArrowPlease), "CSSArrowPlease" in window || (window.CSSArrowPlease = {}),
function (a)
{
  var b = function ()
  {
    this.init.apply(this, arguments)
  };
  b.prototype = {
    init: function (a)
    {
      this.container = a.container, this.model = a.model, this._attachEvents()
    },
    render: function ()
    {
      return this._setDefaults(), this
    },
    _setDefaults: function ()
    {
      var a = this.container,
        b = this.model;
      a.find(".position")
        .val([b.get("position")]), a.find(".size")
        .val(b.get("size")), a.find(".base_color")
        .val(b.get("color")), a.find(".border_width")
        .val(b.get("borderWidth")), a.find(".border_color")
        .val(b.get("borderColor"))
    },
    _attachEvents: function ()
    {
      var a = $.proxy(this._updateModel, this),
        b = $.proxy(this._updateInput, this),
        c = this.container,
        d = [
          {
            classname: ".position",
            keyboard_interactive: !1
          },
          {
            classname: ".size",
            keyboard_interactive: !0
          },
          {
            classname: ".base_color",
            keyboard_interactive: !1
          },
          {
            classname: ".border_width",
            keyboard_interactive: !0
          },
          {
            classname: ".border_color",
            keyboard_interactive: !1
          }];
      $.each(d, function (d, e)
      {
        c.delegate(e.classname, "change", a), e.keyboard_interactive && c.delegate(e.classname, "keydown", b)
      })
    },
    _updateModel: function (a)
    {
      var b = $(a.currentTarget),
        c = b.val(),
        d;
      b.hasClass("border_width") ? d = "borderWidth" : b.hasClass("border_color") ? d = "borderColor" : b.hasClass("base_color") ? d = "color" : d = b.attr("class");
      if (d === "borderWidth" || d === "size") c = parseInt(c, 10);
      this.model.set(d, c)
    },
    _updateInput: function (a)
    {
      if (a.keyCode != 38 && a.keyCode != 40) return;
      var b = $(a.currentTarget),
        c = parseInt(b.val()),
        d = a.keyCode == 38 ? 1 : -1,
        e = a.shiftKey ? 10 : 1,
        f = c + d * e;
      f < 0 && (f = 0), b.val(f), this._updateModel(a)
    }
  }, a.ArrowConfigurationView = b
}(window.CSSArrowPlease), "CSSArrowPlease" in window || (window.CSSArrowPlease = {}),
function (a)
{
  var b = function ()
  {
    this.init.apply(this, arguments)
  };
  b.prototype = {
    init: function (a)
    {
      this.container = a.container, this.model = a.model, this.model.on("change", this._handleChange, this)
    },
    _handleChange: function ()
    {
      this.render()
    },
    render: function ()
    {
      return this.container.text(this.model.toCSS()), this
    }
  }, a.ArrowPreviewView = b
}(window.CSSArrowPlease), "CSSArrowPlease" in window || (window.CSSArrowPlease = {}),
function (a)
{
  var b = function ()
  {
    this.init.apply(this, arguments)
  };
  b.prototype = {
    init: function (a)
    {
      this.container = a.container, this._codeNode = this.container.find(".code"), this._copyNode = this.container.find(".copy_code"), this.model = a.model, this.model.on("change", this._handleChange, this)
    },
    _handleChange: function ()
    {
      this.render()
    },
    render: function ()
    {
      var a = this.model.toCSS();
      return this._codeNode.text(a), this._copyNode.text(a)
        .clippy(
        {
          transparent: !0
        }), this
    }
  }, a.ArrowCSSView = b
}(window.CSSArrowPlease), "CSSArrowPlease" in window || (window.CSSArrowPlease = {}),
function (a)
{
  var b = function ()
  {
    this.init.apply(this, arguments)
  };
  b.prototype = {
    init: function ()
    {
      this.model = new a.Arrow, this._initViews()
    },
    _initViews: function ()
    {
      var b = this.model;
      this.views = [new a.ArrowConfigurationView(
        {
          model: b,
          container: $(".configuration")
        }), new a.ArrowPreviewView(
        {
          model: b,
          container: $('<style type="text/css"></style>')
            .appendTo("body")
        }), new a.ArrowCSSView(
        {
          model: b,
          container: $(".css_result")
        })]
    },
    render: function ()
    {
      $.each(this.views, function (a, b)
      {
        b.render()
      })
    }
  }, a.App = b
}(window.CSSArrowPlease), $(document)
  .ready(function ()
  {
    (new CSSArrowPlease.App)
      .render()
  });
var _gaq = _gaq || [];
_gaq.push(["_setAccount", "UA-30519406-1"]), _gaq.push(["_trackPageview"]),
function ()
{
  var a = function (a, b)
  {
    var c = [],
      d = a.getElementsByTagName(b)[0];
    return function (e, f)
    {
      var g;
      e && $.inArray(e, c) === -1 && (g = a.createElement(b), g.async = !0, g.src = e, g.onload = f || function () {}, d.parentNode.insertBefore(g, d))
    }
  }(document, "script");
  window.onload = function ()
  {
    a(("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js"), a("//platform.twitter.com/widgets.js")
  }
}()